The return value of anchors
varies depending on type
and id
.
If id=FALSE
, a GRanges object will be returned containing the regions specified by the anchor1
or anchor2
slots in x
,
for type=="row"
or "column"
, respectively.
If type="both"
, a GRangesList will be returned with two entries - row
and column
, containing regions specified by anchor1
and anchor2
respectively.
However, if id=TRUE
, the integer vectors in the anchor1
or anchor2
slots of x
are returned directly
(a list of length two is returned for type="both"
, containing both of the vectors).Replacement in anchors<-
can only be performed using anchor indices.
If type="both"
, a list of two integer vectors is required in value
, specifying the indices of the row- and column-wise interacting regions in x
.
If type="row"
or "column"
, an integer vector is required to replace the existing row- or column-wise indices in the anchor1
or anchor2
slot, respectively.
For regions
, a GRanges is returned equal to the regions
slot in x
.
For regions<-
, the GRanges in value
is used to replace the regions
slot.
Resorting of the replacement GRanges is performed automatically, along with re-indexing of the anchors.
In addition, the input GRanges must be of the same length as the existing object in the regions
slot.
The newRegions
replacement method can take variable length GRanges, but requires that the replacement contain (at least) all ranges contained in anchors(x)
.
The appendRegions
replacement method appends extra intervals to the existing regions
slot of x
.
The reduceRegions
method removes unused entries in the regions
slot, to save memory -- see reduceRegions,GInteractions-method
for more details.
The show
method will print out various details of the object, such as the dimensions of the matrix
slot and the length of the regions
slot.
The as.matrix
method will return the value of the matrix
slot, containing the Matrix of interaction data.
Replacement with a Matrix of the same dimensions can be performed using the as.matrix<-
function.
The t
method will transpose the matrix, i.e., switch the rows and columns (and switch the vectors in the anchor1
and anchor2
slots).
The dim
method will return a vector of length 2, containing the dimensions of the matrix
slot.
The dimnames
method will return a list of length 2, containing the row and column names of matrix
(these can be modified with the dimnames<-
method).
The length
method will return an integer scalar corresponding to the total number of entries in the matrix
slot.
As the ContactMatrix class inherits from the Annotated
class, additional metadata can be stored in the metadata
slot.
This can be accessed or modified with metadata,Annotated-method
.